{% extends 'admin/base.html' %}
{% block title %}评论管理{% endblock %}
{% block content %}
<!--Table Styling-->
<table class="display" id="example">
<thead>
    <tr>
        <th class="th_chexbox"><input type="checkbox" name="set" /></th>
        <th class="th_title">作者</th>
        <th class="th_status">评论</th>
        <th class="th_date">文章标题</th>
        <th class="th_author">发表时间</th>
        <th class="th_author">操作</th>
        <th class="th_chexbox"> </th>
    </tr>
</thead>
<tbody>
    {% for c in comments %}
    <tr class="item" data-title="{{ c.diary.title }}" data-author="{{ c.author }}" data-email="{{ c.email }}" data-did="{{ c.diary.pk }}">
        <td><input type="checkbox" name="id[]" value="1" /></td>
        <td class="subject">{{ c.author }}</td>
        <td><span class="published">{{ c.content }}</span></td>
        <td>{{ c.diary.title }}</td>
        <td class="name">{{ c.publish_time.strftime('%Y-%m-%d %H:%M') }}</td>
        <td>{% if c.author != '博主回复' %}<a class="comment_back" href="javascript:void(0);">回复</a>{% endif %}</td>
        <td class="action"><a href="{{ url_for('admin.comment_del', comment_id = c.id) }}" title="删除评论"><img src="{{ url_for('admin.static', filename='images/del.png') }}" alt="delete"></a></td>
    </tr>
    {% endfor %}
</tbody>
</table>
<div class="dataTables_paginate paging_full_numbers" id="example_paginate">
    {% if prev %}
    <a href="{{ url_for('admin.comment_list', page_num = page_num|int - 1) }}"><span class="previous paginate_button paginate_button_disabled">Previous</span></a>
    {% endif %}
    {% if next %}
    <a href="{{ url_for('admin.comment_list', page_num = page_num|int + 1) }}"><span class="next paginate_button">Next</span></a>
    {% endif %}
</div>
<!--Table Styling end-->
{% endblock %}
